<?php

include "../../lib/start.php";

check_session();
check_permission(ADM_PERM);

header("Content-type: text/plain");

$uname = $_POST['nick'];
$pwd = $_POST['pwd'];

$update = "UPDATE alunni SET username = '$uname', password = '$pwd' WHERE id_alunno = ".$_REQUEST['id'];
try{
	$db->executeUpdate($update);
} catch (MySQLException $ex){
	print "ko|".$ex->getQuery()."|".$ex->getMessage();
	exit;
}
print "ok";

?>